/*******************************************************************************
* This file provides the functions for the Output Compare module.
*
* Author: Kong Wai Weng @ Cytron Technologies Sdn. Bhd.
*******************************************************************************/



#ifndef _HAL_OC_H
#define _HAL_OC_H



#include <outcompare.h>
#include "system.h"



/*******************************************************************************
* PUBLIC FUNCTION PROTOTYPES                                                   *
*******************************************************************************/

/*******************************************************************************
* PUBLIC FUNCTION: vInitOc
*
* PARAMETERS:
* ~ void
*
* RETURN:
* ~ void
*
* DESCRIPTIONS:
* Initialize the Output Compare module 1 - 8 to operate in PWM mode.
*
*******************************************************************************/
void vInitOc(void);



/*******************************************************************************
* PUBLIC FUNCTION: vUpdateServo
*
* PARAMETERS:
* ~ ucChannel	- The servo channel that we want to update.
* ~ uiValue		- The servo pulse width value in 0.2us step (Ex: 1.5ms = 7500). 
*
* RETURN:
* ~ void
*
* DESCRIPTIONS:
* Update the servo output.
*
*******************************************************************************/
void vUpdateServo(unsigned char ucChannel, unsigned int uiValue);



#endif
